package com.atguigu.exer5;

public class TestEmployee {
    public static void main(String[] args) {
//        （4）在测试类TestEmployee中的main中，创建两个员工对象，并为他们的姓名和生日赋值，并显示员工的姓名和生日
        Employee e1 = new Employee();
        e1.name ="张三";

       e1.birthday = new MyDate();
        //这种写法，是把变量的声明与给变量的赋值操作分开了
        //声明在Employee类中 MyDate birthday;
        //这里只是赋值。至于赋值什么东西？要看它什么类型，是MyDate类，就给它一个MyDate类型的对象
        e1.birthday.year = 1996;
        e1.birthday.month = 5;
        e1.birthday.day = 1;

        System.out.println("e1的信息：" + e1.name +"，生日:"  +e1.birthday.year +"年" + e1.birthday.month+"月" + e1.birthday.day+"日");

        Employee e2 = new Employee();
        e2.name ="李四";

        MyDate my = new MyDate();
        my.year = 2000;
        my.month = 6;
        my.day = 1;
        e2.birthday = my;

        System.out.println("e2的信息：" + e2.name +"，生日:"  +e2.birthday.year +"年" + e2.birthday.month+"月" + e2.birthday.day+"日");


    }
}
